import java.util.function.Consumer;

import jkoa.core.Context;
import jkoa.core.Middleware;
import jkoa.core.Next;
import jkoa.core.Request;
import jkoa.core.Response;

class YourCustomMiddleware implements Middleware {
    @Override
    public void handle(Context ctx, Next next) {
        // 在请求处理前执行的逻辑
        System.out.println("Before handling request in custom middleware.");
        // 将请求传递给下一个中间件或最终的处理逻辑
        next.execute(ctx);
        // 在请求处理后执行的逻辑
        System.out.println("After handling request in custom middleware.");
    }
}
